﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour {
    public int Speed;
    public static Bullet instance;
	// Use this for initialization
	void Start () {

        Speed = MainPanel.instance.Speed;
       
       
    }

    private void OnEnable()
    {
        Speed = MainPanel.instance.Speed;
    }



    // Update is called once per frame
    void Update () {
        transform.Translate(0, Speed, 0);
        if (gameObject.transform.localPosition.y > 1050) 
        {
            GameTools.instance.BackObj(gameObject, Balloon.Bullet);
        }
	}

    private void OnTriggerEnter2D(Collider2D collision)
    {
        ShortVoice.instance.PlayVoice("FaShe",0.5f);
      
    }
    

}
